import { request } from '@/service/request';

/** 获取测试单表列表 */
export function fetchGetTableList(params?: Api.Demo.TableSearchParams) {
  return request<Api.Demo.TableList>({
    url: '/demo/table/list',
    method: 'get',
    params
  });
}

/** 新增测试单表 */
export function fetchCreateTable(data: Api.Demo.TableOperateParams) {
  return request<boolean>({
    url: '/demo/table',
    method: 'post',
    data
  });
}

/** 修改测试单表 */
export function fetchUpdateTable(data: Api.Demo.TableOperateParams) {
  return request<boolean>({
    url: '/demo/table',
    method: 'put',
    data
  });
}

/** 批量删除测试单表 */
export function fetchBatchDeleteTable(ids: CommonType.IdType[]) {
  return request<boolean>({
    url: `/demo/table/${ids.join(',')}`,
    method: 'delete'
  });
}
